package com.neolix.watch.domain;

import com.neolix.watch.dao.RemindEvent;

import java.util.Date;

import static com.neolix.watch.util.StringUtil.formatTimeToYearAndMonthAndDayString;
import static com.neolix.watch.util.StringUtil.getAMorPM;
import static com.neolix.watch.util.StringUtil.getHmOfDateTime;

public class RemindEventViewModel extends RemindEvent {

    public RemindEventViewModel(Long id, int eventId, String content, java.util.Date eventDateTime, Date createDateTime) {
        super(id, eventId, content, eventDateTime, createDateTime);
    }

    public String getDate() {
        return formatTimeToYearAndMonthAndDayString(getDateTime());
    }

    public String getTime() {
        return getHmOfDateTime(getDateTime());
    }

    public String getAmPm() {
        return getAMorPM(getDateTime());
    }

    public RemindEvent getRemindEvent() {
        return new RemindEvent(getId(), getEventID(), getContent(), getDateTime(), getCreateDateTime());
    }
}
